3.218 \(\int \frac{\tan ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=63 \[ -\frac{a^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{b^{3/2} f (a-b)}+\frac{x}{a-b}+\frac{\tan (e+f x)}{b f} \]

[Out]

x/(a - b) - (a^(3/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/((a - b)*b^(3/2)*f) + Tan[e + f*x]/(b*f)

________________________________________________________________________________________

Rubi [A]  time = 0.106324, antiderivative size = 63, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3670, 479, 522, 203, 205} \[ -\frac{a^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{b^{3/2} f (a-b)}+\frac{x}{a-b}+\frac{\tan (e+f x)}{b f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^4/(a + b*Tan[e + f*x]^2),x]

[Out]

x/(a - b) - (a^(3/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/((a - b)*b^(3/2)*f) + Tan[e + f*x]/(b*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 479

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e^(2*n
- 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(b*d*(m + n*(p + q) + 1)), x] - Dist[e^(2*n)
/(b*d*(m + n*(p + q) + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1) + (a*d*(m +
 n*(q - 1) + 1) + b*c*(m + n*(p - 1) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p, q}, x] && NeQ[b*c - a*d
, 0] && IGtQ[n, 0] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\tan ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\tan (e+f x)}{b f}-\frac{\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{b f}\\ &=\frac{\tan (e+f x)}{b f}+\frac{\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f}-\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) b f}\\ &=\frac{x}{a-b}-\frac{a^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{(a-b) b^{3/2} f}+\frac{\tan (e+f x)}{b f}\\ \end{align*}

Mathematica [A]  time = 0.274144, size = 70, normalized size = 1.11 \[ -\frac{a^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{b^{3/2} f (a-b)}+\frac{e+f x}{f (a-b)}+\frac{\tan (e+f x)}{b f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^4/(a + b*Tan[e + f*x]^2),x]

[Out]

(e + f*x)/((a - b)*f) - (a^(3/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/((a - b)*b^(3/2)*f) + Tan[e + f*x]/(b
*f)

________________________________________________________________________________________

Maple [A]  time = 0.016, size = 70, normalized size = 1.1 \begin{align*}{\frac{\tan \left ( fx+e \right ) }{fb}}-{\frac{{a}^{2}}{fb \left ( a-b \right ) }\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f \left ( a-b \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^4/(a+b*tan(f*x+e)^2),x)

[Out]

tan(f*x+e)/b/f-1/f/b*a^2/(a-b)/(a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2))+1/f/(a-b)*arctan(tan(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.19387, size = 495, normalized size = 7.86 \begin{align*} \left [\frac{4 \, b f x - a \sqrt{-\frac{a}{b}} \log \left (\frac{b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} + 4 \,{\left (b^{2} \tan \left (f x + e\right )^{3} - a b \tan \left (f x + e\right )\right )} \sqrt{-\frac{a}{b}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right ) + 4 \,{\left (a - b\right )} \tan \left (f x + e\right )}{4 \,{\left (a b - b^{2}\right )} f}, \frac{2 \, b f x - a \sqrt{\frac{a}{b}} \arctan \left (\frac{{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt{\frac{a}{b}}}{2 \, a \tan \left (f x + e\right )}\right ) + 2 \,{\left (a - b\right )} \tan \left (f x + e\right )}{2 \,{\left (a b - b^{2}\right )} f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/4*(4*b*f*x - a*sqrt(-a/b)*log((b^2*tan(f*x + e)^4 - 6*a*b*tan(f*x + e)^2 + a^2 + 4*(b^2*tan(f*x + e)^3 - a*
b*tan(f*x + e))*sqrt(-a/b))/(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)) + 4*(a - b)*tan(f*x + e))/((a*b
 - b^2)*f), 1/2*(2*b*f*x - a*sqrt(a/b)*arctan(1/2*(b*tan(f*x + e)^2 - a)*sqrt(a/b)/(a*tan(f*x + e))) + 2*(a -
b)*tan(f*x + e))/((a*b - b^2)*f)]

________________________________________________________________________________________

Sympy [A]  time = 9.16737, size = 493, normalized size = 7.83 \begin{align*} \begin{cases} \tilde{\infty } x \tan ^{2}{\left (e \right )} & \text{for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac{- x + \frac{\tan{\left (e + f x \right )}}{f}}{b} & \text{for}\: a = 0 \\- \frac{3 f x \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} - \frac{3 f x}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac{2 \tan ^{3}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac{3 \tan{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text{for}\: a = b \\\frac{x \tan ^{4}{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text{for}\: f = 0 \\\frac{x + \frac{\tan ^{3}{\left (e + f x \right )}}{3 f} - \frac{\tan{\left (e + f x \right )}}{f}}{a} & \text{for}\: b = 0 \\\frac{2 i a^{\frac{3}{2}} b \sqrt{\frac{1}{b}} \tan{\left (e + f x \right )}}{2 i a^{\frac{3}{2}} b^{2} f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{3} f \sqrt{\frac{1}{b}}} + \frac{2 i \sqrt{a} b^{2} f x \sqrt{\frac{1}{b}}}{2 i a^{\frac{3}{2}} b^{2} f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{3} f \sqrt{\frac{1}{b}}} - \frac{2 i \sqrt{a} b^{2} \sqrt{\frac{1}{b}} \tan{\left (e + f x \right )}}{2 i a^{\frac{3}{2}} b^{2} f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{3} f \sqrt{\frac{1}{b}}} - \frac{a^{2} \log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 i a^{\frac{3}{2}} b^{2} f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{3} f \sqrt{\frac{1}{b}}} + \frac{a^{2} \log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 i a^{\frac{3}{2}} b^{2} f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{3} f \sqrt{\frac{1}{b}}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**4/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x*tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((-x + tan(e + f*x)/f)/b, Eq(a, 0)), (-3*f*x*tan(
e + f*x)**2/(2*b*f*tan(e + f*x)**2 + 2*b*f) - 3*f*x/(2*b*f*tan(e + f*x)**2 + 2*b*f) + 2*tan(e + f*x)**3/(2*b*f
*tan(e + f*x)**2 + 2*b*f) + 3*tan(e + f*x)/(2*b*f*tan(e + f*x)**2 + 2*b*f), Eq(a, b)), (x*tan(e)**4/(a + b*tan
(e)**2), Eq(f, 0)), ((x + tan(e + f*x)**3/(3*f) - tan(e + f*x)/f)/a, Eq(b, 0)), (2*I*a**(3/2)*b*sqrt(1/b)*tan(
e + f*x)/(2*I*a**(3/2)*b**2*f*sqrt(1/b) - 2*I*sqrt(a)*b**3*f*sqrt(1/b)) + 2*I*sqrt(a)*b**2*f*x*sqrt(1/b)/(2*I*
a**(3/2)*b**2*f*sqrt(1/b) - 2*I*sqrt(a)*b**3*f*sqrt(1/b)) - 2*I*sqrt(a)*b**2*sqrt(1/b)*tan(e + f*x)/(2*I*a**(3
/2)*b**2*f*sqrt(1/b) - 2*I*sqrt(a)*b**3*f*sqrt(1/b)) - a**2*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*I*a**(
3/2)*b**2*f*sqrt(1/b) - 2*I*sqrt(a)*b**3*f*sqrt(1/b)) + a**2*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*I*a**(
3/2)*b**2*f*sqrt(1/b) - 2*I*sqrt(a)*b**3*f*sqrt(1/b)), True))

________________________________________________________________________________________

Giac [B]  time = 2.27763, size = 405, normalized size = 6.43 \begin{align*} -\frac{\frac{{\left (a^{2} b + b^{3} + a{\left | -a b + b^{2} \right |} + b{\left | -a b + b^{2} \right |}\right )}{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{4 \, \sqrt{\frac{1}{2}} \tan \left (f x + e\right )}{\sqrt{\frac{4 \, a b + 4 \, b^{2} + \sqrt{-64 \, a b^{3} + 16 \,{\left (a b + b^{2}\right )}^{2}}}{b^{2}}}}\right )\right )}}{a b{\left | -a b + b^{2} \right |} + b^{2}{\left | -a b + b^{2} \right |} +{\left (a b - b^{2}\right )}^{2}} - \frac{{\left (\sqrt{a b}{\left (a + b\right )}{\left | -a b + b^{2} \right |}{\left | b \right |} -{\left (a^{2} b + b^{3}\right )} \sqrt{a b}{\left | b \right |}\right )}{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{4 \, \sqrt{\frac{1}{2}} \tan \left (f x + e\right )}{\sqrt{\frac{4 \, a b + 4 \, b^{2} - \sqrt{-64 \, a b^{3} + 16 \,{\left (a b + b^{2}\right )}^{2}}}{b^{2}}}}\right )\right )}}{{\left (a b - b^{2}\right )}^{2} b^{2} -{\left (a b^{3} + b^{4}\right )}{\left | -a b + b^{2} \right |}} - \frac{\tan \left (f x + e\right )}{b}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-((a^2*b + b^3 + a*abs(-a*b + b^2) + b*abs(-a*b + b^2))*(pi*floor((f*x + e)/pi + 1/2) + arctan(4*sqrt(1/2)*tan
(f*x + e)/sqrt((4*a*b + 4*b^2 + sqrt(-64*a*b^3 + 16*(a*b + b^2)^2))/b^2)))/(a*b*abs(-a*b + b^2) + b^2*abs(-a*b
 + b^2) + (a*b - b^2)^2) - (sqrt(a*b)*(a + b)*abs(-a*b + b^2)*abs(b) - (a^2*b + b^3)*sqrt(a*b)*abs(b))*(pi*flo
or((f*x + e)/pi + 1/2) + arctan(4*sqrt(1/2)*tan(f*x + e)/sqrt((4*a*b + 4*b^2 - sqrt(-64*a*b^3 + 16*(a*b + b^2)
^2))/b^2)))/((a*b - b^2)^2*b^2 - (a*b^3 + b^4)*abs(-a*b + b^2)) - tan(f*x + e)/b)/f